package com.dp.mallchat.common.chat.service;

import com.dp.mallchat.common.chat.domain.entity.Message;
import com.dp.mallchat.common.chat.domain.vo.req.*;
import com.dp.mallchat.common.chat.domain.vo.req.member.MemberReq;
import com.dp.mallchat.common.chat.domain.vo.resp.ChatMemberStatisticResp;
import com.dp.mallchat.common.chat.domain.vo.resp.ChatMessageResp;
import com.dp.mallchat.common.chat.domain.vo.resp.MsgReadInfoResp;
import com.dp.mallchat.common.chat.domain.vo.resp.MsgReadPageResp;
import com.dp.mallchat.common.common.domain.vo.resp.CursorPageBaseResp;
import com.dp.mallchat.common.user.domain.ws.resp.ChatMemberResp;

import java.util.Collection;
import java.util.List;

public interface ChatService {
    /**
     * 获取推送消息响应对象
     * @param message 消息
     * @param uid   uid
     * @return
     */
    ChatMessageResp getMsgResp(Message message, Long uid);

    /**
     * 发送者获取消息内容，更快速响应
     * @param msgId 消息id
     * @param uid uid
     * @return
     */
    ChatMessageResp getMsgRespApi(Long msgId, Long uid);

    /**
     * 批量组装会话消息
     * @param messageList 消息
     * @param uid uid
     * @return
     */
    List<ChatMessageResp> getMsgRespBatch(List<Message> messageList, Long uid);


    /**
     * 获取会话消息列表
     * @param req 请求参数
     * @param uid uid
     * @return
     */
    CursorPageBaseResp<ChatMessageResp> getContactMsgPage(ContractMsgPageReq req, Long uid);

    /**
     * 撤回消息
     * @param req 请求参数
     * @param uid uid
     */
    void recall(ReCallReq req, Long uid);

    /**
     * 获取消息的已读未读总数
     * @param uid uid
     * @param request 请求参数
     * @return
     */
    Collection<MsgReadInfoResp> getMsgReadInfo(Long uid, ChatMessageReadInfoReq request);

    /**
     * 消息已读
     * @param uid   uid
     * @param request 请求参数
     */
    void msgRead(Long uid, ChatMessageMemberReq request);

    /**
     * 消息点踩
     * @param uid uid
     * @param request 请求参数
     */
    void msgMark(Long uid, ChatMessageMarkReq request);

    /**
     * 消息已读未读列表
     * @param uid uid
     * @param request 请求参数
     * @return
     */
    CursorPageBaseResp<MsgReadPageResp> msgReadPage(Long uid, MsgReadPageReq request);

    /**
     * 获取群成员列表
     *
     * @param memberUidList
     * @param request
     * @return
     */
    CursorPageBaseResp<ChatMemberResp> getMemberPage(List<Long> memberUidList, MemberReq request);

    ChatMemberStatisticResp getMemberStatistic();
}
